<?php

class Quad_Data_Email extends Quad_Data_Abstract {
	
	public function __construct($email = '') {
		$this->raw = $email;
		$this->email = trim($email);
	}
	
	public static function create($email) {
		return new self($email);
	}
	
	public function isValid() {
		return preg_match('/^\w+[^@\s]*@[^@\s]+\.\w+$/', $this->email);
	}
	
	public function hasMxRecord() {
		// http://php.net/manual/en/function.getmxrr.php
	}

	public function format() {
		return $this->email;
	}
		
}